package com.cpj.bsyyzx.controller;


import com.cpj.bsyyzx.entity.AccountRole;
import com.cpj.bsyyzx.service.IAccountRoleService;
import com.cpj.bsyyzx.util.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 五个臭皮匠
 * @since 2021-05-09
 */
@RestController
@RequestMapping("/accountRole")
public class AccountRoleController {
    @Autowired
    IAccountRoleService accountRoleService;
    @RequestMapping("/getByUserId")
    CommonResult getByUserId(Integer accId) {
        return CommonResult.success(accountRoleService.getByAccId(accId));
    }
    @RequestMapping("save")
    CommonResult save(AccountRole accountRole){
        return CommonResult.success(accountRoleService.saveOrUpdate(accountRole));
    }
}
